/* //引入一级路由
import Home from "@/pages/Home"
import Search from "@/pages/Search"
import Login from "@/pages/Login"
import Register from "@/pages/Register"
import Detail from "@/pages/Detail"
import AddCartSuccess from "@/pages/AddCartSuccess"
import ShopCart from "@/pages/ShopCart"
import Trade from "@/pages/Trade"
import Pay from "@/pages/Pay"
import PaySuccess from "@/pages/PaySuccess"
import Center from "@/pages/Center"
//引入二级路由
import MyOrder from "@/pages/Center/myOrder"
import GroupOrder from "@/pages/Center/groupOrder" */

//全部改写为路由懒加载





//路由配置信息
export default [
    {
        path: "/center",
        component: () => import("@/pages/Center")
        ,
        meta: { show: true },
        //二级路由组件
        children: [
            {
                path: "myorder",
                component: () => import("@/pages/Center/myOrder")
                ,

            },
            {
                path: "grouporder",
                component: () => import("@/pages/Center/groupOrder"),
            }
            ,
            {
                path: '/center',
                redirect: '/center/myorder'
            }
        ]
    },
    {
        path: "/paysuccess",
        component: () => import("@/pages/PaySuccess")
        ,
        meta: { show: true },

    },
    {
        path: "/pay",
        component: () => import("@/pages/Pay")
        ,
        meta: { show: true },
        beforeEnter: (to, from, next) => {
            //去支付页面,必须从交易页面来
            if (from.path == '/trade') {
                next()
            } else {
                //其他组件停留当前
                next(false)
            }
        }
    },
    {
        path: "/trade",
        component: () => import("@/pages/Trade")
        ,
        meta: { show: true },
        beforeEnter: (to, from, next) => {
            //去交易页面,必须从购物车来
            if (from.path == '/shopcart') {
                next()
            } else {
                //其他组件停留当前
                next(false)
            }
        }

    },
    {
        path: "/shopcart",
        component: () => import("@/pages/ShopCart")
        ,
        meta: { show: true }
    },
    {
        path: "/addcartsuccess",
        name: "addcartsuccess",
        component: () => import("@/pages/AddCartSuccess")
        ,
        meta: { show: true }
    },
    {
        path: "/detail/:skuid",
        component: () => import("@/pages/Detail")
        ,
        meta: { show: true }
    },
    {
        path: "/home",
        component: () => import("@/pages/Home")
        ,
        meta: { show: true }
    },
    {
        name: 'search',
        path: "/search/:keyword?",
        component: () => import("@/pages/Search")
        ,
        meta: { show: true }
    },
    {
        path: "/login",
        component: () => import("@/pages/Login")
        ,
        meta: { show: false }
    },
    {
        path: "/register",
        component: () => import("@/pages/Register")
        ,
        meta: { show: false }
    },
    //重定向
    {
        path: "*",
        redirect: "/home"
    }
]